package com.github.springboot.service.impl;

import com.github.springboot.dao.UserJpaRepository;
import com.github.springboot.entity.User;
import com.github.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by kjtang on 2018/1/17.
 */

@Service
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserJpaRepository userJpaRepository;

    @Override
    public void addUser(User user) {
        System.out.println("新增用户信息成功:"+user);
    }

    public User getUserById(Long id){
        return userJpaRepository.getById(id);
    }

}
